package sites.manager.common.model;

import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
public class Site extends Model<Site> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long id;
	
	@NotBlank(message = "站点名称不可为空")
	private String siteName;
	
	@NotBlank(message = "站点标示不可为空")
	private String siteSign;
	private String siteUrl;
	private String siteTitle;
	private String siteKeys;
	private String siteDes;

	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String accessLog;
	
	@Min(value = 1, message = "图片限制大小需>1")
	private Integer imgMaxSize;
	
	@Min(value = 1, message = "文件限制大小需>1")
	private int fileMaxSize;
	
	@Min(value = 1, message = "视频限制大小需>1")
	private int videoMaxSize;
	
	@NotBlank(message = "图片格式不可为空")
	private String imgSuffix;
	
	@NotBlank(message = "文件格式不可为空")
	private String fileSuffix;
	
	@NotBlank(message = "视频格式不可为空")
	private String videoSuffix;
	
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private Date updateTime;

	private String status;
	
}
